﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DesignDemo
{
    class SpaceShip : GameObject
    {
        List<WeaponSystem> WeaponSystems;

        public SpaceShip()
        {
            WeaponSystems = new List<WeaponSystem>();
        }

        public void AddWeaponSystem(WeaponSystem system)
        {
            WeaponSystems.Add(system);
        }

        public void FireWeapons()
        {
            for (int i = 0; i < WeaponSystems.Count; i++)
            {
                WeaponSystems[i].Fire();
            }
        }

        public void Reload()
        {
            for (int i = 0; i < WeaponSystems.Count; i++)
            {
                WeaponSystems[i].Reload();
            }
        }

        public override void Update()
        {
            for (int i = 0; i < WeaponSystems.Count; i++)
            {
                WeaponSystems[i].Update();
            }
            base.Update();
        }
    }
}
